Repository navigation
Conversation
|
Which title prints |
|
I do not have title traces or Dinkumware _Printf evidence for these wide-format cases. The current evidence is FreeBSD 11.4 behavior and Linux-side tests, so I cannot claim console compatibility for %q, %D/%O/%U, unknown conversions, or a trailing %. I agree this leaves the added behavior unverified against the console; absent title or _Printf evidence, main’s throw is safer. I will avoid presenting these cases as title-required until we have that evidence. |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the fix. Blocking points:
- The console's
libc.prxformats through Dinkumware's_Printf, not FreeBSD'svfwprintf. As discussed above, neither a title nor_Printfevidence shows that%q,%D/%O/%U, unknown conversions (with width) or a trailing%behave as FreeBSD 11.4 does there; main's throw is the safe behaviour until then. Evidence that would unblock it: the relevant branches of_Printfdisassembled from a title'slibc.prx(same approach as in #3987), or a title that reaches these cases. - Once evidence exists, the branch conflicts with main in
core/libs/tests/GuestWideFormatting.cpp; it needs a rebase.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
I have some hardware data for these cases, though not the kind the review asks for. @adriadam10: this is libSceLibcInternal.sprx's Setup: an ELF payload (ps5-payload-dev/sdk v0.44, clang 18.1.8), started from a payload manager, resolves Compared with
Main does not match this output either: Not measured: a title or its I can attach the probe source and the full log if that helps. |
178de73 to
db5c096
Compare
|
Rebased onto current main ( |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the rebase. Blocking points:
- New console data in this thread (@ionut27001,
swprintffromlibSceLibcInternal.sprxon firmware 12.70) contradicts the behaviour this PR implements:%qd,%D,%O,%Uand unknown conversions such as%yare printed as literal text (width pads the whole%y/%qd;h/hhare dropped), and%mand%lqdprint as text too. The PR formats them the FreeBSD way (-5,5000000000,y), so the tests and the debt line would pin values the console does not produce. The trailing%case was not cleanly measured. Please rework against that data, or keep main's throw for what is still unmeasured. - The head does not compile after the rebase:
core/libs/tests/GuestWideFormatting.cppdefinesCheckGroupingFlag(lines 149 and 247) andCheckSwprintf(lines 189 and 256) twice, andmaincallsCheckSwprintf()twice (lines 351, 354). docs/dev/debt/libc.mdnow has the "narrow printf family" line twice (95, 99) and two "Guest path resolution" lines (104, with a stray.., plus the old one); only the wide printf line should be added.
|
Thanks for the probe and review. It confirms behavior in |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks, the rebase now looks clean (no duplicate helpers or debt lines). The main blocking point is unchanged:
FormattingWide.cpp:144-157,216-222formats%qd,%D/%O/%Uand unknown conversions the FreeBSD way, andGuestWideFormatting.cpp:213-244plus the debt line pin those values. The only console measurement in this thread (@ionut27001,swprintffromlibSceLibcInternal.sprx, firmware 12.70) prints all of them as literal text (width pads the whole%y/%qd,h/hhdropped), and%m/%lqdprint as text too, while the tests expect an exception for those two. It is a different module than a title'slibc.prx, but it is the only hardware data and it contradicts this code; nothing supports the FreeBSD behaviour on the console.- To unblock: either implement the measured behaviour (and say in the debt line that it comes from
libSceLibcInternal.sprx, not measured onlibc.prx), or drop these cases and keep main's throw until_Printffrom a title'slibc.prxis disassembled or a title reaches them.
9c0f626 to
3c74c99
Compare
|
I updated the implementation and regression cases to match the reported At head |
…t in the wide printf family The wide printf family rejected the q length modifier, the D, O and U conversions, unknown conversion characters and a format ending in a percent sign, which FreeBSD 11.4 vfwprintf formats: q is long long, D, O and U are the long forms of d, o and u, an unknown conversion character prints itself with the width and the - flag, and the format ends at a trailing percent sign. swprintf, vswprintf and wprintf now do the same; snwprintf_s keeps rejecting them.
…te pair whole as an unknown conversion snwprintf_s accepted the q length modifier through the shared parser and now rejects it again. An unknown conversion character that is a surrogate pair is printed as one character, so the width padding no longer splits the pair.
3c74c99 to
06bd246
Compare
|
The review follow-up is now rebased onto current |
|
Thanks for approving. I have kept the module-specific measured behavior and the remaining title |
What
Updates non-secure guest wide
printfformatting to match the measured literal-text behavior for%q,%D/%O/%U, unknown conversions, and width handling observed fromlibSceLibcInternal.sprxon firmware 12.70. The probe calledswprintffrom a payload process; it did not exercise a title or its bundledlibc.prx, whose Dinkumware_Printfbehavior remains unverified. The probe also showed that a trailing%read past the format terminator, so incomplete conversions continue to fail safely. The securesnwprintf_spath continues to reject these forms because its console behavior was not measured.The original implementation commits retain Hussein Kadhim as author, and the original test commits retain MarcZX100. The review follow-up is authored by MarcZX10.
Tested
Linux x86-64, GCC 12.2.0, CMake 3.25.1, Ninja, Release:
guest_wide_formatting_tests;ctest -R guest_wide_formatting --output-on-failure: 1/1 passed.python3 tools/check_conventions.py --base upstream/main --head HEAD: passed.git diff --check upstream/main...HEAD: passed.No title
libc.prxruntime test, Windows build, or full test suite was run.Checklist
main; no other open PR implements the same wide-format functions.mdfiles or images added to the repository